package com.atguigu.rabbitmqtest.four;

import com.atguigu.rabbitmqtest.utils.RabbitMqUtils;
import com.rabbitmq.client.Channel;

import java.util.Scanner;

public class Producer {
    public static void main(String[] args) throws Exception {
        Channel channel = RabbitMqUtils.getChannel();

        while (true){
            Scanner scanner = new Scanner(System.in);
            String message = scanner.nextLine();
            channel.basicPublish("myexchange",
                    "",
                    null,
                    message.getBytes("UTF-8"));
        }

    }
}
